/*  File Name	: DirectoryService.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-10-30
 *  Description:
 */

#ifndef DirectorySERVICE_H_
#define DirectorySERVICE_H_
#include "Service.h"

class DirectoryMonitor;

class DirectoryService:public ServiceEX<DirectoryMonitor>
{
private:
	typedef ServiceEX<DirectoryMonitor> super;

public:
	DirectoryService(int p=0);
	virtual ~DirectoryService();

	virtual int open(void *p = 0);

	virtual int handle_input(int fd = INVALID_HANDLER);

	virtual int handle_output(int fd = INVALID_HANDLER);

	virtual int handle_timeout(void);

	virtual int handle_close(int handle = INVALID_HANDLER, ReactorMask mask =
			EventHandler::ALL_MASK);

	//int recycle(DirectoryService *s);

	virtual int recv_msg(const int limit_size = 1024 * 60);

	void reset(void);

	std::string name(void);

	const int server_id(void);

	void server_id(int server_id);

	const int game_type(void);

	void game_type(int game_type);

private:
	int server_id_;
	int game_type_;
};

#endif /* DATASYNCSERVICE_H_ */
